/*实力评级----list*/
EMui.vmRating=(function(){
    var views={};



    //队伍
    views.teams=[
        new LeafView({
            id:"#ratingTeams",
            state:{isShow:true},
            param:{
                url:EMui.urls.domain+EMui.urls.ratingTeams,
                data:{ _start:0, _limit:10 }
            }
        })
    ];

    //选手
    views.palyers=[
        new LeafView({
            id:"#ratingPlayers",
            state:{isShow:false},
            param:{
                url:EMui.urls.domain+EMui.urls.ratingPlayers,
                data:{ _start:0, _limit:10 }
            }
        })
    ];


    //切换标签
    var tab=$("#ratingType"),lis=$("li",tab),viewName,curView=null;
    lis.on("changetab",function(){
        viewName=$(this).data("view");
        curView=views[viewName];

        for(var arr in views){
            if(curView==views[arr]){
                $.each(views[arr],function(n,view){
                    view.state.isShow=true;
                    if(view.vm.list.length<=0){
                        view.fillData();
                    }
                });
            }else{
                $.each(views[arr],function(n,view){
                    view.state.isShow=false;
                });
            }

        }




    });



    return{
        init:function(){
            for(var arr in views){
                $.each(views[arr],function(n,view){
                    if(view.state.isShow){
                        view.fillData();
                    }
                });
            }
        },

        reloadData:function(){
            for(var arr in views){
                $.each(views[arr],function(n,view){
                    view.param.data={_start:view.oldParamPage._start,_limit:view.oldParamPage._limit};
                    view.state.isNoneData=false;
                    view.vm.list=[];
                    if(view.state.isShow){
                        if(view.isLoadMore){view.offLoadMore();}
                        view.fillData();
                    }
                });
            }
        }
    }
})();



